﻿/**
 * Copyright (C) 2012 original author and authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NGuice.Inject.Spi;

namespace NGuice.Inject.Internal
{
    /// <summary>
    /// C#泛型没有通配符，使用标记接口解决此类问题
    /// </summary>
    public interface InternalFactory
    {
        object Get(Errors errors, InternalContext context, Dependency dependency, bool linked);
    }
    /// <summary>
    /// 创建将被注入的对象工厂
    /// </summary>
    public interface InternalFactory<T> : InternalFactory
    {
        /// <summary>
        /// 创建一个将被注入的对象
        /// Creates an object to be injected.
        /// </summary>
        /// <param name="errors"></param>
        /// <param name="context">此注入的上下文</param>
        /// <param name="Dependency"></param>
        /// <param name="linked">是否获取链接的binding</param>
        /// <Exception ref="ErrorsException">如果不能提供值则抛出异常</Exception>
        /// <returns>被注入的实例</returns>
        T Get(Errors errors, InternalContext context, Dependency dependency, bool linked);
    }
}
